<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath%>">
		<meta charset="utf-8" />
	<link href="css/style.css" rel="stylesheet" type="text/css" />
	   <script type="text/javascript" src="js/weekpicker.js" ></script>
</head>
<body  onload="initDate();">
    <ul class="forminfo" style="margin-top: 20px;">
    
    	<li><label>选择时间范围</label><input type="text" class="dfinput" name="dateScope" id="dateScope"  /><a href="javascript:void(0);"  onclick="backDate();">上一周</a>&nbsp;<a href="javascript:void(0);" onclick="nextDate();" >下一周</a></li>
    	<li><label>工作周</label><input type="text" class="dfinput" name="week"  id="week"  readonly /></li>
    	<li><label>主要工作内容</label><textarea class="long_text long_text2 " name="WorkContent" maxlength="1000"></textarea></li>
    	<li><label>实习心得体会</label><textarea class="long_text long_text2 " name="WorkFeel" maxlength="1000"></textarea></li>
	<li><label>&nbsp;</label><input name="" type="button" class="btn" onclick="submitForm();" value="提交"/></li>
    </ul>
</body>
	<script type="text/javascript" src="js/jquery-1.7.2.js"></script>
     <script type="text/javascript" src="js/jquery.tips.js"></script>
  
     <script src="layer/layer.js"></script>
	<script type="text/javascript" >
	var p = '${jobStudent}';
	function initDate() {
		var practiceD = new Date(p);
		startYear = practiceD.getFullYear();
		startMonth = practiceD.getMonth();
		
		calculateDate();
	}

	function submitForm() {
		if ($("textarea[name='WorkContent']").val() == "") {
			showTips($("textarea[name='WorkContent']"), '请填写主要工作内容!');
			return false;
		}
		if ($("textarea[name='WorkFeel']").val() == "") {
			showTips($("textarea[name='WorkFeel']"), '请填写心得体会!');
			return false;
		}
		$.ajax({
			type: "POST",
							url : "weeknote/weeknote_save.do",
							data : {
								dateScope :$("input[name='dateScope']").val(),
								week : $("input[name='week']").val(),
								WorkContent :$("textarea[name='WorkContent']").val(),
								WorkFeel : $("textarea[name='WorkFeel']").val(),
								},
							async: true,   
							dataType:'json',
							success : function(data) {
								if ("success" == data.result) {
									parent.closeAll();
								} else {
									layer.alert('添加失败!', {
										skin : 'layer-ext-moon'
									});
								}
							}
						})
		}
	function showTips(obj, tips) {
		obj.tips({
			side : 3,
			msg : tips,
			bg : '#e69138',
			time : 2
		});
	}

</script>
</html>
